package com.tongguan.paypos.view;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.tongguan.paypos.R;

/**
 * Created by Joylive on 2016/12/12 .
 */

public class CustomPopDialog extends Dialog {

    private ImageView mImageView;
    private String mUrl;

    public CustomPopDialog(Context context,String url) {
        super(context,R.style.CustomDialog);
        mUrl = url;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.custom_dialog_pop);
        // 点击对话框区域外禁止取消对话框
        setCanceledOnTouchOutside(false);
        initView();
    }

    private void initView() {
        mImageView = (ImageView) findViewById(R.id.iv_qr_img);
        Glide.with(getContext())
                .load(mUrl)
                .into(mImageView);
    }
}
